export let home = {
    namespaced: true,
    state: {
        peopleData: null,
    },
    actions: {
        PostPeopleData(store, data = {}) {
            // let url = "/postUrl/file-export-and-import/postPeopleData"; // 模拟接口
            let url = "/people/get"; // 公司接口
            return new Promise((resolve, reject) => {
                axios.post(url, data).then(({
                    data
                }) => {
                    store.commit('setPeopleData', data);
                    resolve(data);
                }).catch((error) => {
                    if (error.response) {
                        // 请求已发出，但服务器响应的状态码不在 2xx 范围内
                        reject(error.response.data)
                    }
                });
            });
        },
    },
    mutations: {
        setPeopleData(state, data = {}) {
            state.peopleData = data;
        },
    }
}